<?php
    /*
    *   Template name: Контакты
    *   Template post type: page
    */
    
    get_header();?>
    <?php $contacts = carbon_get_theme_option('contacts');?>
    <?php $social_network = carbon_get_theme_option('social_network');
    // 
  
    
     ?>
<section class="content">
    <div>
    <?php
        foreach($contacts as $contact):
        $userFoto = wp_get_attachment_image_url( $contact['foto']  , 'thumbnail');?>
            <div class="contacts">
                <div class="cntacts__foto">
                    <img src="<?php echo $userFoto?>" alt="">
                </div>
                <div class="contacts__data">
                    <div class="contacts__name">
                        <p class="contacts__lastName"><?php echo $contact['last_name']?>.</p>
                        <p class="contacts__Name"><?php echo $contact['name']?>.</p>
                        <p class="contacts__patronymic"><?php echo $contact['patronymic']?>.</p>
                    </div>
                    <div class="contacts_phone">
                        <p>По любому поваду:</p>
                        <p><a href="tel:<?php echo  $contact['phone_number']?>"><?php echo  $contact['phone_number']?></a></p>
                    </div>
                </div>
            </div>
            <?php endforeach;?>
        </div>
        <div>
            <?php 
                foreach($social_network as $network ):
                $networkFoto = wp_get_attachment_image_url( $network['logo'], 'thumbnail');
                // pr($network );
            ?>
            <div class="socialNetwork">
                <div class="socialNetwork__logo">
                    <a href="https://vk.com/"><img src="<?php echo $networkFoto?>" alt="VK"></a>
                </div>
                <div class="socialNetwork__linck">
                    <h3><a href="<?php echo $network['social_network_link'] ?>"><?php echo $network['social_network_link'] ?></a></h3>
                </div>
            </div>
            <?php endforeach;?>
        </div>
</section>


    <?php get_footer();